package com.yige.common


import java.text.SimpleDateFormat


/**
 * Created by sunhao on 2015/10/14 0014.
 */

class NumUtil {

    static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd")


    static int createNumByGoodsClass(int classNum){
        return classNum + 1
    }

    static int createNumByGoodsClass(String groupNum){
        return Integer.parseInt(groupNum + "01")
    }

    static String createNumByGoods(String goodsNum){
        def newNum = Integer.parseInt(goodsNum) + 1 as int
        def newStr = Integer.toString(newNum)
        def lastStr = newStr.substring(newStr.length() - 3, newStr.length())
        return currentDate() + lastStr


//        return Integer.toString(Integer.parseInt(goodsNum) + 1)
    }

    static String createNumByGoodsNew(int classNum){
        return classNum + currentDate() + "001"
    }

    static String currentDate() {
        return dateFormat.format(new Date())
    }

    static String createNumByGoodGroup(){

    }

    static String createNumByGoodGroup(int groupNum){
        return Integer.toString(groupNum + 1)
    }

}
